#!/usr/bin/env python3
#
# Software License Agreement (MIT License)
# Author: Duke Fong <d@d-l.io>

import cgi, sys, os, json
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from conf.gconf import gconf
from sub import captcha

print('Content-Type: application/json; charset=utf-8\n')

dat = captcha.get()
if dat:
    print(json.dumps(dat, indent=2, ensure_ascii=False, sort_keys=False))
else:
    print('{"error": "captcha.get error"}')

